#!/bin/bash
# /etc/init.d/auto_ad_service


case "$1" in
    start)
        echo "Starting auto_ad_service"
        /home/pi/python_project/auto_ad/auto_ad_service.py &
        ;;
    stop)
        echo "Stopping auto_ad_service"
        kill $(ps aux | grep -m 1 'python /home/pi/python_project/auto_ad/auto_ad_service/py' | awk '{ print $2 }')
        ;;
    *)
        echo "Usage: service auto_ad_service start|stop"
        exit 1
        ;;
esac
exit 0


